package com.xian.im.modules.sensitive.handler;

import java.util.Collection;

/**
 * @program: xian-im-server
 * @description: 敏感词过滤
 * @author: liru.xian
 * @create: 2021-02-23 11:29
 **/
public interface SensitiveBloom {
    public static final String GUAVA_TYPE = "guava:sensitive:bloom";
    public static final String REDIS_TYPE ="redis:sensitive:bloom";
    /**
     *  初始化敏感词库
     * @param
     * @return
     */
    boolean loadSensitive();

    /**
     * 布隆类型
     */
    String getType();

    /**
     * 添加敏感词
     * @param word
     * @return
     */
    Boolean add(String word);

    /**
     * 添加敏感词
     * @param words
     * @return
     */
    Boolean addAll(Collection<String> words);

    /**
     *  判断是否是敏感词
     * @param word
     * @return
     */
    Boolean includeByBloomFilter(String word);

    /**
     *
     * @return
     */
    Boolean reset();
}
